package org.kl.wx.entity;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.kl.bf.entity.AuditableEntity;
import org.kl.bf.entity.Excel;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name = "wx_event_record")
public class EventRecord extends AuditableEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2871379815806443619L;
	@Excel(exportName = "所属公共账号", exportProperty = "appName")
	private App app;
	@Excel(exportName = "接收方账号")
	private String toUserName;
	@Excel(exportName = "发送方帐号")
	private String fromUserName;
	@Excel(exportName = "创建时间的时间戳")
	private Timestamp msgCreateTime;
	@Excel(exportName = "消息类型")
	private String msgType;
	@Excel(exportName = "事件信息")
	private String event;
	@Excel(exportName = "事件KEY值")
	private String eventKey;
	@Excel(exportName = "二维码的ticket")
	private String ticket;
	@Excel(exportName = "地理位置纬度")
	private String latitude;
	@Excel(exportName = "地理位置经度")
	private String longitude;
	@Excel(exportName = "地理位置精度")
	private String precision;

	public EventRecord() {
	}

	public EventRecord(String id) {
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name = "app_id")
	public App getApp() {
		return app;
	}

	public void setApp(App app) {
		this.app = app;
	}

	public String getToUserName() {
		return toUserName;
	}

	public void setToUserName(String toUserName) {
		this.toUserName = toUserName;
	}

	public String getFromUserName() {
		return fromUserName;
	}

	public void setFromUserName(String fromUserName) {
		this.fromUserName = fromUserName;
	}

	@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+08:00")
	public Timestamp getMsgCreateTime() {
		return msgCreateTime;
	}

	public void setMsgCreateTime(Timestamp msgCreateTime) {
		this.msgCreateTime = msgCreateTime;
	}

	public String getMsgType() {
		return msgType;
	}

	public void setMsgType(String msgType) {
		this.msgType = msgType;
	}

	public String getEvent() {
		return event;
	}

	public void setEvent(String event) {
		this.event = event;
	}

	public String getEventKey() {
		return eventKey;
	}

	public void setEventKey(String eventKey) {
		this.eventKey = eventKey;
	}

	public String getTicket() {
		return ticket;
	}

	public void setTicket(String ticket) {
		this.ticket = ticket;
	}

	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}
	@Column(name = "accuracy")
	public String getPrecision() {
		return precision;
	}

	public void setPrecision(String precision) {
		this.precision = precision;
	}

}
